home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1994 April / Nautilus CD Magazine Volume 4-4 April 1994 Windows Edition.mdf / setup / nautcd / link / infonet.scr < prev    next >
Text File  |  1993-08-18  |  2KB  |  83 lines

  1. !
  2. !  Copyright (c) 1993
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  InfoNet:
  9. !    Connect to InfoNet or InfoNet-Europe.  Arg1 contains TRUE if
  10. !    connect is to InfoNet-Europe and FALSE otherwise.
  11. !    Success:  returns %Success
  12. !    Failure:  saves error msg in %FailureMsg and returns %Failure
  13. !
  14. !+V
  15. ! "3.1"
  16. !-V
  17.  
  18. Europe = Arg1;
  19.  
  20. if Europe goto Init_Europe;
  21. show "Connecting to InfoNet World-Connect";
  22. FailStr  = "InfoNet World-Connect not responding";
  23. FailStr2 = "InfoNet World-Connect not connecting";
  24. goto Init_Common;
  25.  
  26. Init_Europe:
  27.     show "Connecting to InfoNet Euro-Connect";
  28.     FailStr = "InfoNet Euro-Connect not responding";
  29.     FailStr2 = "InfoNet Euro-Connect not connecting";
  30.  
  31. Init_Common:
  32.     Tries = 5;
  33.     Timeout = 10;
  34.     Got_Center = %FALSE;
  35.     on cancel goto Return_Cancel;
  36.  
  37. Wait_InfoNet:
  38.     wait
  39.         "#"        goto Send_Response,
  40.         "Center"    goto Send_InfoNet_Host,
  41.         "Centre"    goto Send_InfoNet_Host,
  42.         "COMMUNICATION"    goto Return_Success
  43.     until Timeout;
  44.  
  45.     Timeout = 50;
  46.     if Tries = 0 goto InfoNet_Failure;
  47.  
  48.     Tries = Tries - 1;
  49.     send %CR & %CR & %CR;
  50.     goto Wait_InfoNet;
  51.  
  52. Send_Response:
  53.     if Got_Center goto Wait_InfoNet;
  54.     send "C" & %CR;
  55.     Timeout = 195;
  56.     goto Wait_InfoNet;
  57.  
  58. Send_InfoNet_Host:
  59.     if Europe goto Send_InfoNet_Europe_Host;
  60.     send "CPS" & %CR;
  61.     goto Finish_Send_Host;
  62.  
  63. Send_InfoNet_Europe_Host:
  64.     send "CSF" & %CR;
  65. Finish_Send_Host:
  66.     FailStr = FailStr2;
  67.     if Tries = 0 goto InfoNet_Failure;
  68.  
  69.     Tries = Tries - 1;
  70.     Got_Center = %TRUE;
  71.     Timeout = 835;
  72.     goto Wait_InfoNet;
  73.  
  74. InfoNet_Failure:
  75.     define %FailureMsg = FailStr;
  76.     exit %Failure;
  77.  
  78. Return_Cancel:
  79.     exit %Cancel;
  80.  
  81. Return_Success:
  82.     exit %Success;
  83.